﻿#include "TestSuite.h"

#include <QtTest/QtTest>

#include <iostream>

TestSuite::TestSuite()
: m_testList()
{

}

TestSuite & TestSuite::instance()
{
	static TestSuite * suite = new TestSuite();
	return *suite;
}

bool TestSuite::run(bool breakOnFairule)
{
	bool result = true;

	foreach (QObject * obj, m_testList) {
		std::cout << std::endl;

		if (QTest::qExec(obj)) {
			
			result = false;

			if (breakOnFairule) {
				std::cout << std::endl;
				break;
			}
		}

		std::cout << std::endl << std::endl;
	}

	return result;
}
